<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //   let str = "hello";
      //合并拼接字符串
      // console.log(str.concat("", "world"));
      //提取字符串，并返回新的字符串
      //console.log(str.slice(-5, -3));
      //   //  可以将字符串按照一定的字符分隔成数组
      //   let str = "abcd,1,234,5";
      //   let newArr = str.split(",");
      //   console.log(newArr, "newArr");
      //   let arr = [1, 2, 3, 4, 5, 6, 7, 8];
      //   //  slice(起始位置，结束位置)，返回的数据包左不包右，返回的值是新的数组，并不改变原数组
      //   let arr1 = arr.slice(2, 5);
      //   arr[2] = "c";
      //   console.log(arr1, "arr.slice(2, 5)");

      //   let str = "apple";
      //   str.indexOf("a");
    </script>
  </body>
</html>
